﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="chapter1.aspx.cs" Inherits="chapter1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="No" 
            DataSourceID="RiskManage">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="No" HeaderText="No" InsertVisible="False" 
                    ReadOnly="True" SortExpression="No" />
                <asp:BoundField DataField="CNo" HeaderText="CNo" SortExpression="CNo" />
                <asp:BoundField DataField="CName" HeaderText="CName" SortExpression="CName" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="RiskManage" runat="server" 
            DataFile="~/App_Data/RiskManage.mdb" 
            DeleteCommand="DELETE FROM [ChapterList] WHERE [No] = ?" 
            InsertCommand="INSERT INTO [ChapterList] ([No], [CNo], [CName]) VALUES (?, ?, ?)" 
            SelectCommand="SELECT [No], [CNo], [CName] FROM [ChapterList]" 
            UpdateCommand="UPDATE [ChapterList] SET [CNo] = ?, [CName] = ? WHERE [No] = ?">
            <DeleteParameters>
                <asp:Parameter Name="No" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="CNo" Type="Int32" />
                <asp:Parameter Name="CName" Type="String" />
                <asp:Parameter Name="No" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="No" Type="Int32" />
                <asp:Parameter Name="CNo" Type="Int32" />
                <asp:Parameter Name="CName" Type="String" />
            </InsertParameters>
        </asp:AccessDataSource>
    
    </div>
    </form>
</body>
</html>
